CHDK Development : Which files do what?
Introduction This wiki page describes every file used in CHDK development that might need to be customized for a port to a new camera. Each entry briefly describes what information the file contains, has a little bit about where to find that information and some pointers to what might go wrong if those values are wrong. At some point this will probably need to be broken across several pages. Files Customized for each Firmware Version of a Camera (in trunk/platform/cameraname/sub/fwversion) stubs_entry_2.S This file is used to for all the addresses that are not discovered automatically during the CHDK build process. In the build process, a "find signature" routine is used to examine a dumped file for the camera firmware called "primary.bin". It looks for matches to know code sequences for routines in the camera ROM that CHDK wants to use. If it does not find such a match, or finds a poor match, then the correct address needs to be entered in stubs_entry_2.S. You need to examine stubs_entry.S and find replacements for any routine not identied 100% or satisfy yourself that the found routine is correct. There may also be addresses not included in stubs_entry.S that need to be added to stubs_entry_2.S - typrically because they are for routines not needed when the original "find signature" code was written. lib.c This file contains constant values and addresses related to the camera's LCD size, the image sensor size and the buffers used by the camera to hold image data. These values are used to scale the CHDK GUI and to enable RAW&DNG capture and motion detection. stubs_min.S This file contains addresses or offsets in camera RAM when the camera maintains values related to its operation. There are also two values pointing to locations in ROM> boot.c This file contains the code for three CHDK task - boot, PhySw and file_modules. The boot task is the first code executed by CHDK after it is loaded into RAM by the boot loader. In addition to setting up CHDK, it initiates the task hooks for the other CHDK tasks. The PhySw task intercepts camera key presses, allowing CHDK to respond to them before the Canon firmware sees them. The file_modules task adds FAT32 capability to CHDK. Code for these task is dissassembled from the camera firmware and CHDK specific hooks are inserted. capt_seq.c movie_rec.c Makefile makefile.inc stubs_asm.h stubs_entry.S stubs_auto.S primary.bin Files Customized for all Firmware Versions of a Camera (in trunk/platform/cameraname) kdb.c lib.c main.c Makefile notes.txt platform_camera.h shooting.c wrappers.c (in trunk/loader/cameraname/) blobs.S entry.S main.c Makefile (in trunk/loader/cameraname/resetcode) entry.S main.c Makefile Files Customized in Main Code Files for Specific Cameras trunk/core/gui.c *short cut key buttons - adjustable ALT button - raw exceptions trunk/core/gui_menu.c *customized menu space trunk/core/kbd.c *ZSTEP_TABLE_SIZE, nTxtbl if camera supports syncable remote *custom shoot processing trunk/core/main.c * customized dump_memory for IXUS65 only trunk/core/raw.c * customize gammma value calculations for sx30 & G12 trunk/include/kbd.c * customize USB_MASK (belongs elsewhere) trunk/platform/generic/shooting.c * customized shooting_get_drive_mode() for some cameras * custom hacks for iris control of sx30 & g12 * strange vague hack for CAMERA_ixus800_sd700 trunk/platform/generic/wrappers.c * assorted hacks for functions not found in stubs_entry.S for G12, SX30, S95 Files Customize to Add a New Camera or Firmware Version to CHDK Makefile makefile.inc Category:DevelopmentCategory:CHDK internals